﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp.事件
{
    public class Cat
    {
        /// <summary>
        /// 猫叫了
        /// </summary>
        public void Meow()
        {
            Console.WriteLine("猫叫了");
        }

        #region 事件用到的
        public event Action catEventAction = null;

        public void CatEventActionMethod()
        {
            if (catEventAction != null)
            {
                Console.WriteLine("开始蝴蝶效应了");
                catEventAction.Invoke();
            }
        }
        #endregion
    } 
}
